﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.App.Intrastructure.Migrations
{
    public partial class _1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "farmCompanyModels",
                columns: table => new
                {
                    FCId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Farm = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FarmPerson = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Number = table.Column<int>(type: "int", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_farmCompanyModels", x => x.FCId);
                });

            migrationBuilder.CreateTable(
                name: "farmModels",
                columns: table => new
                {
                    FId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Day = table.Column<int>(type: "int", nullable: false),
                    FeedBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FuZePerson = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OutTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_farmModels", x => x.FId);
                });

            migrationBuilder.CreateTable(
                name: "healthModels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Day = table.Column<int>(type: "int", nullable: false),
                    HealthFangShi = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthFangFa = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_healthModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "imgModels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ImgUrl = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ImgType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_imgModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "killCompanyModels",
                columns: table => new
                {
                    Kid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CompanyAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CompanyDesc = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_killCompanyModels", x => x.Kid);
                });

            migrationBuilder.CreateTable(
                name: "killInformationModels",
                columns: table => new
                {
                    KillId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Weight = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ArrivalTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    KillTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_killInformationModels", x => x.KillId);
                });

            migrationBuilder.CreateTable(
                name: "processingCompanyModels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TeamGroups = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FuPeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_processingCompanyModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "processingModels",
                columns: table => new
                {
                    Pid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProductionNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_processingModels", x => x.Pid);
                });

            migrationBuilder.CreateTable(
                name: "shopModels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Sname = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_shopModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "supplierProfileModels",
                columns: table => new
                {
                    Sid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_supplierProfileModels", x => x.Sid);
                });

            migrationBuilder.CreateTable(
                name: "traceabilityModels",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Sid = table.Column<int>(type: "int", nullable: false),
                    ProduceBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Shelflife = table.Column<int>(type: "int", nullable: false),
                    ProduceNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manufacturers = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DegreeinFormation = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreatePeople = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatePeople = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_traceabilityModels", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "farmCompanyModels");

            migrationBuilder.DropTable(
                name: "farmModels");

            migrationBuilder.DropTable(
                name: "healthModels");

            migrationBuilder.DropTable(
                name: "imgModels");

            migrationBuilder.DropTable(
                name: "killCompanyModels");

            migrationBuilder.DropTable(
                name: "killInformationModels");

            migrationBuilder.DropTable(
                name: "processingCompanyModels");

            migrationBuilder.DropTable(
                name: "processingModels");

            migrationBuilder.DropTable(
                name: "shopModels");

            migrationBuilder.DropTable(
                name: "supplierProfileModels");

            migrationBuilder.DropTable(
                name: "traceabilityModels");
        }
    }
}
